#include<stdio.h>
int main()
{
    int low=1,high=4;
    int good,ans;
    good=scanf("%d",&ans);
    
    while( good==1 && (ans<low || ans>high) )
    {
        printf("%d is not a valid choice; try again: ",ans);
        scanf("%d",&ans);
    }
    if (good!=1)
    {
        printf("Non-numeric input. ");
        ans=4;
    }
    printf("ans=%d",ans);

    return 0;
}